﻿<Window x:Class="CloudWallet.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="{Binding Title,Mode=OneWay}" 
        Height="480" Width="640" 
        Icon="cloudWallet_16x16.png"
        WindowStartupLocation="CenterScreen"
        FontSize="18">
    <Window.Resources>
        <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="30"/>
            <RowDefinition Height="1*"/>
        </Grid.RowDefinitions>
        <Menu FontSize="14">
            <MenuItem Header="File">
                <MenuItem x:Name="btnNew" Header="New" Click="btnNew_Click_1">
                    <MenuItem.Icon>
                        <Image Source="Images/new.png" Height="24"  RenderOptions.BitmapScalingMode="Fant"/>
                    </MenuItem.Icon>
                </MenuItem>
                <MenuItem x:Name="btnOpen" Header="Open" Click="btnOpen_Click_1">
                    <MenuItem.Icon>
                        <Image Source="Images/open.png" Height="24"  RenderOptions.BitmapScalingMode="Fant"/>
                    </MenuItem.Icon>
                </MenuItem>
                <!--<MenuItem x:Name="btnOpenCloud" Header="Open From Cloud" Click="btnOpenCloud_Click_1" />-->
                <MenuItem x:Name="btnSave" Header="Save" Click="btnSave_Click_1" IsEnabled="{Binding IsChanged}">
                    <MenuItem.Icon>
                        <Image Source="Images/save.png" Height="24" RenderOptions.BitmapScalingMode="Fant" />
                    </MenuItem.Icon>
                </MenuItem>
                <MenuItem x:Name="btnSaveAs" Header="Save As" Click="btnSaveAs_Click_1" IsEnabled="{Binding IsChanged}">
                    <MenuItem.Icon>
                        <Image Source="Images/saveas.png" Height="24" RenderOptions.BitmapScalingMode="Fant" />
                    </MenuItem.Icon>
                </MenuItem>
                <!--<MenuItem x:Name="btnSaveCloud" Header="Save To Cloud" Click="btnSaveCloud_Click_1" IsEnabled="{Binding IsChanged}" />-->
                <Separator />
                <MenuItem x:Name="btnExit" Header="Exit" Click="btnExit_Click_1" />
            </MenuItem>
            <MenuItem x:Name="btnAbout" Header="About" Click="btnAbout_Click_1"  />
        </Menu>
        <Grid Grid.Row="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="1*"/>
                <ColumnDefinition Width="2*"/>
            </Grid.ColumnDefinitions>
            <Grid Grid.Column="0">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="50" />
                        <RowDefinition Height="50" />
                        <RowDefinition />
                    </Grid.RowDefinitions>
                    <Button x:Name="btnAdd" Content="Add" FontSize="18" Grid.Row="0" Margin="3" Click="btnAdd_Click_1" />
                    <Button x:Name="btnDelete" Content="Delete" FontSize="18" Grid.Row="1" Margin="3" IsEnabled="{Binding IsAnyItemSelected}" Click="btnDelete_Click_1" />
                    <Border Grid.Row="2" Margin="3" Background="Chocolate" CornerRadius="3">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="30" />
                                <RowDefinition />
                            </Grid.RowDefinitions>
                            <TextBox Margin="3" FontSize="12" Text="{Binding SearchText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
                            <ListBox Grid.Row="1" Margin="5" DisplayMemberPath="Title" ItemsSource="{Binding FilteredItems}" SelectedItem="{Binding SelectedItem, Mode=TwoWay}" SelectionMode="Single" Background="Transparent" BorderBrush="Transparent" />
                        </Grid>
                    </Border>
                </Grid>
            </Grid>
            <Grid Grid.Column="1" IsEnabled="{Binding IsAnyItemSelected}">
                <Border Margin="3" BorderBrush="Orange" BorderThickness="2" CornerRadius="3" Background="Wheat">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="100"/>
                            <ColumnDefinition/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="50" />
                            <RowDefinition Height="50" />
                            <RowDefinition />
                        </Grid.RowDefinitions>
                        <Label Grid.Row="0" Grid.Column="0" Content="Title" VerticalContentAlignment="Center"/>
                        <Label Grid.Row="1" Grid.Column="0" Content="Content" VerticalContentAlignment="Center"/>
                        <TextBox Grid.Column="1" Grid.Row="0" Margin="3" Text="{Binding SelectedItem.Title, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" VerticalContentAlignment="Center" FontWeight="Bold" />
                        <TextBox Grid.Column="0" Grid.Row="3" Grid.ColumnSpan="2" Margin="3" Text="{Binding SelectedItem.Content, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" TextWrapping="Wrap" ScrollViewer.VerticalScrollBarVisibility="Visible" FontWeight="Normal" AcceptsReturn="True" />
                    </Grid>
                </Border>
            </Grid>
        </Grid>
    </Grid>
</Window>
